/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package daoGenerico;

import entidades.Pessoa;
import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
 *
 * @author marcos
 */
public class PessoaDAO {
    public Pessoa buscaEmail(String email){
        EntityManager em=new JPAManager().getManager();
        Pessoa p ;
     
        try {
            p = (Pessoa) em.createQuery("SELECT p FROM Pessoa p WHERE p.email = '"+email+"'");
        return p;
        } catch (Exception e) {
            return null;
        }
        
    
    }
    
}
